<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>货品信息管理</title>
</head>
	<link rel="stylesheet" type="text/css" href="/wms/js/plugins/jquery-easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="/wms/js/plugins/jquery-easyui/themes/icon.css">
	<script type="text/javascript" src="/wms/js/plugins/jquery-easyui/jquery.min.js"></script>
	<script type="text/javascript" src="/wms/js/plugins/jquery-easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/wms/js/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="/wms/js/plugins/fancybox/jquery.fancybox.js?v=2.1.5"></script>
	<link rel="stylesheet" type="text/css" href="/wms/js/plugins/fancybox/jquery.fancybox.css?v=2.1.5" media="screen" />
	<script type="text/javascript" src="/wms/js/common/common.js"></script>
	<script type="text/javascript" src="/wms/js/common/product.js"></script>
	<%@include file="/WEB-INF/views/common/page.jsp" %>
<body class="easyui-layout">
	<s:if test="hasActionMessages()">
			<script type="text/javascript">
				var msg = '<s:property value="actionMessages[0]"/>';
				$.messager.alert('操作提示', msg, 'info',function() {
					refreshAllTab();
				});
			</script>
		</s:if>
	<div data-options="region:'north',border:false" style="height: 10%">
		<form id="queryForm" method="post" action="/wms/product.action" style="margin-top: 15px">
			<s:hidden name="qo.currentPage"/>
			<s:hidden name="qo.pageSize"/>
			关键字&nbsp;<s:textfield name="qo.keyword"/>&nbsp;
			所属品牌&nbsp;<s:select name="qo.brandId" list="#brands" listKey="id" listValue="name" headerKey="-1" headerValue="全部"></s:select>&nbsp;
			<a class="easyui-linkbutton" data-options="text:'查询',iconCls:'icon-search'" onclick="query()"></a>
		</form>
	</div>
	<div data-options="region:'south',border: false" style="height: 90%">
		<table id="table_datagrid">
			<thead>
				<tr>
					<th data-options="field:'id',align:'center'">编号</th>
					<th data-options="field:'image',width:1,align:'center'">货品图片</th>
					<th data-options="field:'name',width:1,align:'center'">货品名称</th>
					<th data-options="field:'sn',width:1,align:'center'">货品编码</th>
					<th data-options="field:'product',width:1,align:'center'">所属品牌</th>
					<th data-options="field:'costPrice',width:1,align:'center'">成本价</th>
					<th data-options="field:'salePrice',width:1,align:'center'">销售价</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="#objs">
					<tr>
						<td><s:property value="id" /></td>
						<td><a class="fancybox" href="<s:property value='imagePath'/>" title="<s:property value='name'/>"><img src="<s:property value='smallImagePath'/>" alt="暂无图片" /></a></td>
						<td><s:property value="name" /></td>
						<td><s:property value="sn" /></td>
						<td><s:property value="%{brand == null ? '品牌' : brand.name}" /></td>
						<td><s:property value="costPrice" /></td>
						<td><s:property value="salePrice" /></td>
						<td><s:property value="imagePath" /></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		
		<div id="dg_tb" style="display: none">
			<a class="easyui-linkbutton" data-options="text:'添加',iconCls:'icon-add',plain:true,onClick:add" data-url="/wms/product_input.action"></a>
			<a class="easyui-linkbutton" data-options="text:'编辑',iconCls:'icon-edit',plain:true,onClick:edit" data-url="/wms/product_input.action?product.id="></a>
			<a class="easyui-linkbutton" data-options="text:'删除',iconCls:'icon-remove',plain:true,onClick:remove" 
				data-url="/wms/product_delete.action?product.id="></a> 
			<a class="easyui-linkbutton" data-options="text:'刷新',iconCls:'icon-reload',plain:true,onClick:query"></a>
		</div>
	</div>
</body>
</html>
